export default {
  namespace: 'order',
  state: {
    total: 0,
    pageNumber: 1,
    loading: false,
    pageSize: 10,
    list: [{
      key: '1',
      orderId: '65536',
      billingTime: '2017-3-21\n08:10',
      orderFrom: '前台开单',
      room: '005号',
      orderStatus: '未结账',
      clockStatus: '全部上钟',
      orderInfo: '306号技师 牛奶足浴 ￥300/111分钟',
      orderAmount: '￥300',
      paidAmount: '￥300',
      customerInfo: '老王1',
      serviceTime: '2017-3-21\n08:10',
    }, {
      key: '2',
      orderId: '65536',
      billingTime: '2017-3-21\n08:10',
      orderFrom: '前台开单323323',
      room: '005号',
      orderStatus: '未结账',
      clockStatus: '全部上钟',
      orderInfo: '306号技师 牛奶足浴￥300/111分钟+306号技师 牛奶足浴 ￥300/111分钟',
      orderAmount: '￥300',
      paidAmount: '￥300',
      customerInfo: '老王2',
      serviceTime: '2017-3-21\n08:10',
    }, {
      key: '3',
      orderId: '65536',
      billingTime: '2017-3-21\n08:10',
      orderFrom: '前台开单',
      room: '005号',
      orderStatus: '未结账',
      clockStatus: '全部上钟',
      orderInfo: '306号技师 牛奶足浴 ￥300/111分钟',
      orderAmount: '￥300',
      paidAmount: '￥300',
      customerInfo: '老王3',
      serviceTime: '2017-3-21\n08:10',
    }],
    modalVisible: false,
    modalLoading: false,
    modalType: 'create',
    btnLoading: false,
    typeVisible: false,
    typeBtnLoading: false,
    item: {},
    query: {},
  },
  reducers: {
    query(state, action){
      return {...state, ...action.payload};
    },
    detail(state, action){
      return {...state, ...action.payload, modalVisible: true};
    },
    hideModal(state, action){
      return {...state, ...action.payload, modalVisible: false}
    },
  },
  effects: {
    *searchInCondition({payload},{call,put,select}){
      // yield call
    }
  },

  subscriptions: {
    setup({dispatch, history}) {
      history.listen(location => {
        // dispatch({
        //   // type: 'query',
        //   // payload: {
        //   //   pageNumber: 1,
        //   //   pageSize: 10,
        //   // }
        // });
      });
    }
  },
}
